home *** CD-ROM | disk | FTP | other *** search
/ Internet Standards / CD1.mdf / winsock / hacker / 93-11 / 000001_paul@atlas.dev.abccomp.oz.au_Wed Nov 17 03:56:01 1993.msg < prev    next >
Internet Message Format  |  1993-11-29  |  8KB

  1. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  2.           id AA29737; Tue, 16 Nov 1993 16:49:13 -0500
  3. Received: by usage.csd.unsw.OZ.AU id AA13614
  4.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 17 Nov 1993 08:47:02 +1100
  5. Received: by atlas (4.1/1.35)
  6.     id AA06368; Wed, 17 Nov 93 08:56:02 EST
  7. Message-Id: <9311162156.AA06368@atlas>
  8. From: paul@atlas.abccomp.oz.au
  9. Date: Wed, 17 Nov 1993 08:56:01 -0500
  10. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  11. To: dmw@digilab.bio-rad.com,
  12.         Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  13. Subject: Re: Timeouts on WSAAsyncSelect FD_READ
  14.  
  15. Thus expounded David Watt on Nov 10, 7:35pm:
  16. /--------------------
  17. |By the way, I have a question about setting FD_CONNECT on UDP sockets.
  18. |Now granted, UDP sockets don't make connections.  But if you set
  19. |FD_CONNECT, and then use the connect() call on a UDP socket to set
  20. |the destination address for subsequent send() calls, shouldn't the
  21. |socket window receive an FD_CONNECT message?  The specification is,
  22. |to my mind, ambiguous on the subject: in the description of the
  23. |connect() function, it says:
  24. |
  25. |"2. If your application is using the message-based WSAAsyncSelect() to indicate interest in connection events, then your application will receive an FD_CONNECT message when the connect operation is complete."
  26. |
  27. |How does this apply to UDP sockets?  In the NT implementation, which is
  28. |the only one I've tested this on, UDP sockets never receive FD_CONNECT
  29. |messages, which is a mild annoyance when trying to implement a protocol
  30. |simulateously in TCP and UDP.
  31.  
  32. This is actually a thorny problem. I was going to reply "of course a connect()
  33. on a UDP socket should have a FD_CONNECT message sent"... but ...
  34.  
  35.     For TCP sockets,
  36. calling WSAAsyncSelect() puts the socket in non-blocking mode automaticaly.
  37. Since connect() for TCP sockets could take arbitrary time, it then returns
  38. SOCKET ERROR / WSAEWOULDBLOCK, and you get the FD_CONNECT message some time
  39. later. For UDP sockets, though, connect() is never a blocking call - it proceedsimmediately, and will not return a WSAEWOULDBLOCK error.
  40.     I guess they have implemented it so that you only get an asynchronous
  41. message (FD_CONNECT) if the related connect() attempt failed with
  42. WSAEWOULDBLOCK. An interesting experiment would be to try to connect() to
  43. a local socket on the same machine - say through address 127.0.0.1. using TCP.
  44. and seeing if that returns a WSAEWOULDBLCOK error (although I guess there's
  45. no reason why not) and if not, whether you still get a FD_CONNECT message.
  46.  
  47.     Check if your UDP connect is returning SOCKET_ERROR/WSAEWOULDBLOCK.
  48. If so, you definitely should get an FD_CONNECT message soon after. If the
  49. UDP connect() succeeds, there is no need to post a FD_CONNECT message - you
  50. already know its connected.
  51.  
  52.  
  53. -- 
  54. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  55. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  56. 579 Harris St., Ultimo   |                         |  been superseded.
  57. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  58. From paul@atlas.dev.abccomp.oz.au Wed Nov 17 04:00:09 1993
  59. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  60.           id AA29835; Tue, 16 Nov 1993 16:50:19 -0500
  61. Received: by usage.csd.unsw.OZ.AU id AA13723
  62.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 17 Nov 1993 08:50:15 +1100
  63. Received: by atlas (4.1/1.35)
  64.     id AA06438; Wed, 17 Nov 93 09:00:10 EST
  65. Message-Id: <9311162200.AA06438@atlas>
  66. From: paul@atlas.abccomp.oz.au
  67. Date: Wed, 17 Nov 1993 09:00:09 -0500
  68. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  69. To: rcq@ftp.com, Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  70. Subject: Re: recv() after FD_CLOSE
  71.  
  72. Thus expounded Bob Quinn on Nov 10,11:29pm:
  73. /--------------------
  74. |>  >BTW, you might want to select on FD_READ and FD_CLOSE; when you get an
  75. |>  >FD_CLOSE, be sure to read until it no longer makes sense to do so.
  76. |
  77. |Since FD_CLOSE is posted when a connection is closed gracefully
  78. |or ungracefully (i.e. when TCP <FIN> or <RST> is received).  And
  79. |since a host cannot possibly send data after sending a TCP <FIN>
  80. |or <RST>.  It doesn't ever make sense to read after getting an
  81. |FD_CLOSE.  Why should you?
  82.  
  83. Oh dear - FD_CLOSE wars again. I beleive the reason is that some stacks post
  84. FD_CLOSE as soon as the <FIN> arrives - whether there is still more data
  85. to be read in the incoming buffer or not. So getting an FD_CLOSE is no
  86. guarantee there is not still more data to read - you must keep reading after
  87. FD_CLOSE until recv() returns 0, and then you have truly hit the end of
  88. the data stream.
  89.  
  90. | Bob Quinn                                             rcq@ftp.com
  91. | FTP Software, Inc.                                No. Andover, MA
  92.  
  93. So when _exactly_ does FTP's WINSOCK post the FD_CLOSE message ? :-)
  94.  
  95.  
  96. -- 
  97. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  98. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  99. 579 Harris St., Ultimo   |                         |  been superseded.
  100. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  101. From paul@atlas.dev.abccomp.oz.au Mon Nov 22 06:11:44 1993
  102. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  103.           id AB18211; Sun, 21 Nov 1993 19:26:00 -0500
  104. Received: by usage.csd.unsw.OZ.AU id AA22284
  105.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Mon, 22 Nov 1993 11:25:29 +1100
  106. Received: by atlas (4.1/1.35)
  107.     id AA19089; Mon, 22 Nov 93 11:11:44 EST
  108. Message-Id: <9311220011.AA19089@atlas>
  109. From: paul@atlas.abccomp.oz.au
  110. Date: Mon, 22 Nov 1993 11:11:44 -0500
  111. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  112. To: winsock-hackers@sunsite.unc.edu
  113. Subject: non-blocking lingering close
  114.  
  115. I've been looking at using non-blocking calls, but emulating the behaviour
  116. of a blocking close, and have determined there is no real way to
  117. do so given the 1.1 interface spec. A "blocking graceful close" is when
  118. closesocket is called on a socket with a non-zero linger time, and it
  119. should block, waiting for all the buffered outgoing data to be sent and
  120. acknowledged before returning.
  121.  
  122.     The problem is that there is currently no way to determine if there
  123. is still buffered data waiting to be written. Ioctlsocket() has the FIONREAD
  124. parameter, to return an indication of data waiting to be read, but there is
  125. no corresponding FIONWRITE parameter to determine if buffered data is still
  126. waiting to be sent to the remote host, or has not been acknowledged.
  127.  
  128.     What are people's thoughts on emulating a lingering close, and whether
  129. a new ioctlsocket() parameter could be defined for version 2.0.
  130.  
  131.  
  132.  
  133. -- 
  134. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  135. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  136. 579 Harris St., Ultimo   |                         |  been superseded.
  137. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  138. From 100121.373@compuserve.com Fri Nov 22 01:38:20 1993
  139. Received: from dub-img-1.compuserve.com by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.06) with SMTP
  140.           id AA23911; Mon, 22 Nov 1993 06:41:12 -0500
  141. Received: from localhost by dub-img-1.compuserve.com (8.6.4/5.930129sam)
  142.     id GAA20483; Mon, 22 Nov 1993 06:41:11 -0500
  143. Date: 22 Nov 93 06:38:20 EST
  144. From: Franck LEFEVRE <100121.373@compuserve.com>
  145. To: "INTERNET:winsock-hackers" <winsock-hackers@sunsite.unc.edu>
  146. Cc: "INTERNET:winsock-users@s" <winsock-users@sunsite.unc.edu>,
  147.         "INTERNET:winsock@sunsite" <winsock@sunsite.unc.edu>
  148. Subject: WSDIR932
  149. Message-Id: <931122113820_100121.373_BHJ47-1@CompuServe.COM>
  150.  
  151. WSDIR the WinSock directory
  152.  
  153. The WSDIR932 of November 17th, 1993 is now available.
  154.  
  155. The first goal of WSDIR is to provide a regularly-updated directory of  WinSock
  156. applications, implementations and development tools. It contains only, and will
  157. always only contain, data sheets that have been  directly filled by poeple
  158. responsible for the product submitted.
  159.  
  160. There are 3 official ways to get a copy of WSDIR :
  161.  
  162.     1) K1's BBS (France)  (33) 33.39.22.13       Files Area :  TCP/IP
  163.     2) CompuServe             Forum : MSNETWORKS
  164.     3) Anonymous FTP to ftp.demon.co.uk:/pub/ibmpc/winsock  (thanks,  Steve)
  165.  
  166.  
  167.  
  168. Franck LEFEVRE 
  169. K1 Informatique
  170. 100121.373@compuserve.com